package net.asfun.jvalog.vo;

import java.util.Date;

import net.asfun.jvalog.common.InteractException;
import net.asfun.jvalog.entity.Phase;
import net.asfun.jvalog.util.ValueFormater;

public class Archive{

	private Phase phase;
	
	public Archive(Phase pha) {
		if ( pha == null ) {
			throw new InteractException("Archive not found");
		}
		phase = pha;
	}
	
	public Date getDate() {
		return phase.getDate();
	}
	
	public int getCount() {
		return phase.getCount();
	}
	
	public String getLink() {
		return Site.getInstance().getUrl() + ValueFormater.date2string(phase.getDate(), "yyyy/MM");
	}
	
}
